package com.reguang.config;

import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.reguang.exception.NotFoundException;

/**
 * 
 * <p>Title: GlobalNotFound</p>
 * <p>Description: 全局404处理</p>
 * @author weibiao
 * @date 2019年12月26日
 */
@RestController
public class GlobalNotFound implements ErrorController {

	@RequestMapping(value = "/error", method = { RequestMethod.GET, RequestMethod.POST })
	public void error() {
		throw new NotFoundException();
	}

	@Override
	public String getErrorPath() {
		return null;
	}

}
